<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>KityMinder Example</title>

    <link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
    <link rel="stylesheet" href="src/kityminder.css" rel="stylesheet">

    <style type="text/css">
        body {
            margin: 0;
            padding: 0;
        }

        #minder-view {
            position: absolute;
            border: 1px solid #ccc;
            left: 10px;
            top: 10px;
            bottom: 10px;
            right: 10px;
            width: 100%;
            height: 100%;
        }
    </style>

    <script type="text/javascript" src="node_modules/kity/dist/kity.js"></script>
</head>
<body>
    <script id="minder-view" type="application/kityminder" minder-data-type="json">
    {
        "template":"custom",
        "theme":"custom-blue",
        "root": {
            "data": {
                "text": "总成",
                "nodeType":1
            },
            "children": [
                { 
                    "data": { "text": "OP10 - 电机组装", "nodeType":2, "direction":"right" },
                    "children": [
                        {
                            "data": { "text": "电机功能：电能转化机械能", "nodeType":3, "color":"#3CB371" },
                            "children": [
                                {"data": { "text": "FE：AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", "nodeType":3, "color":"#FF3030" }}
                            ]
                        },
                        {
                            "data": { "text": "最终功能：车窗能够上升下降", "nodeType":3, "color":"#3CB371" },
                            "children": [
                                {"data": { "text": "FE：BBB", "nodeType":3, "color":"#FF3030" }}
                            ]
                        },
                        {
                            "data": { "text": "最终功能：车窗能够上升下降", "nodeType":3, "color":"#3CB371" },
                            "children": [
                                {"data": { "text": "FE：BBB", "nodeType":3, "color":"#FF3030" }}
                            ]
                        },
                        {
                            "data": { "text": "OP1030 - 轴承压入", "nodeType":2, "color":"#FF3030"},
                            "children": [
                                {
                                    "data": { "text": "功能：轴承密封", "nodeType":3, "color":"#3CB371" },
                                    "children": [
                                        {"data": { "text": "FM：AAA", "nodeType":3, "color":"#FF3030" }},
                                        {
                                            "data" : {"text": "人：人员操作", "nodeType":2 },
                                            "children": [
                                                {
                                                    "data": { "text": "在加载完成时，操作人员按下按钮释放压入", "nodeType":3, "color":"#3CB371" },
                                                    "children": [
                                                        {
                                                            "data": { "text": "FC：AAA", "nodeType":3, "color":"#FF3030" },
                                                            "children": [
                                                                {"data": { "text": "预防措施：AAA", "nodeType":3, "color":"#FF1493" }},
                                                                {"data": { "text": "探测措施：AAA", "nodeType":3, "color":"#FF1493" }}
                                                            ]
                                                        },
                                                        {"data": { "text": "FC：BBB", "nodeType":3, "color":"#FF3030" }},
                                                        {"data": { "text": "FC：CCC", "nodeType":3, "color":"#FF3030" }}
                                                    ]
                                                },
                                                {
                                                    "data": { "text": "将轴承拿出撞到传动轴最顶端", "nodeType":3, "color":"#3CB371" },
                                                    "children": [
                                                        {"data": { "text": "FC：AAA", "nodeType":3, "color":"#FF3030" }}
                                                    ]
                                                }
                                            ]
                                        },
                                        {
                                            "data" : {"text": "机：工装设备", "nodeType":2 },
                                            "children": [
                                                {
                                                    "data": { "text": "工装设备无磨损", "nodeType":3, "color":"#3CB371" },
                                                    "children": [
                                                        {"data": { "text": "FC：AAA", "nodeType":3, "color":"#FF3030" }}
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },{
                    "data": { "text": "壳体", "nodeType":2},
                    "children": [
                        {
                            "data": { "text": "功能12222222222222222222222", "nodeType":3, "color":"#3CB371" },
                            "children": [
                                {
                                    "data": { "text": "FM：失效模式", "nodeType":3, "color":"#FF3030" },
                                    "children": [
                                        {
                                            "data": { "text": "FC：失效原因", "nodeType":3, "color":"#FFD700" },
                                            "children": [
                                                {"data": { "text": "PC：预防措施", "nodeType":3, "color":"#87CEFF" }},
                                                {"data": { "text": "DC：探测措施", "nodeType":3, "color":"#87CEFF" }}
                                            ]
                                        }
                                    ]
                                }
                            ]
                        },{
                            "data": { "text": "II 壳体-驻车机构", "nodeType":3, "color":"#BA55D3" },
                            "children": [
                                {
                                    "data": { "text": "功能1", "nodeType":3, "color":"#3CB371" },
                                    "children": [
                                        {
                                            "data": { "text": "FM：失效模式", "nodeType":3, "color":"#FF3030" },
                                            "children": [
                                                {
                                                    "data": { "text": "FC：失效原因", "nodeType":3, "color":"#FFD700" },
                                                    "children": [
                                                        {"data": { "text": "PC：预防措施", "nodeType":3, "color":"#87CEFF" }},
                                                        {"data": { "text": "DC：探测措施", "nodeType":3, "color":"#87CEFF" }}
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        },{
                            "data": { "text": "IO 壳体-电机", "nodeType":3, "color":"#BA55D3" }
                        }
                    ]
                },{
                    "data": { "text": "壳体2", "nodeType":21, "color":"#3CB371"}
                },{
                    "data": { "text": "功能11111111111111111111111111", "nodeType":31, "color":"#3CB371"}
                },{
                    "data": { "text": "功能2", "nodeType":31, "color":"#3CB371"}
                }
            ]
        }
    }
    </script>
</body>

<!-- *************************** Module 形式加载引入 **************************** -->
<script type="text/javascript" src="node_modules/seajs/dist/sea-debug.js"></script>
<script type="text/javascript">
    /* global seajs */
    seajs.config({
        base: './src'
    });
    define('start', function(require) {
        var Minder = require('kityminder').Minder;

        // 创建 km 实例
        var km = window.km = new Minder();
        km.setup('#minder-view');
    });
    seajs.use('start');
</script>
</html>